<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - cover.info - /home/andres/Programacion/aso_coverage/aso/src/ASO/framework/combinatory_policy_comp_imp.h</title>
  <link rel="stylesheet" type="text/css" href="../../../../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td width="5%"></td>
          <td width="10%" class="headerItem">Current view:</td>
          <td width="35%" class="headerValue"><a href="../../../../../../../../index.html">directory</a> - <a href="index.html">home/andres/Programacion/aso_coverage/aso/src/ASO/framework</a> - combinatory_policy_comp_imp.h (source / <a href="combinatory_policy_comp_imp.h.func.html">functions</a>)</td>
          <td width="10%"></td>
          <td width="10%" class="headerCovTableHead">Found</td>
          <td width="10%" class="headerCovTableHead">Hit</td>
          <td width="15%" class="headerCovTableHead">Coverage</td>
          <td width="5%"></td>
        </tr>
        <tr>
          <td></td>
          <td class="headerItem">Test:</td>
          <td class="headerValue">cover.info</td>
          <td class="headerItem">Lines:</td>
          <td class="headerCovTableEntry">34</td>
          <td class="headerCovTableEntry">34</td>
          <td class="headerCovTableEntryHi">100.0 %</td>
        </tr>
        <tr>
          <td></td>
          <td class="headerItem">Date:</td>
          <td class="headerValue">2010-08-03</td>
          <td class="headerItem">Functions:</td>
          <td class="headerCovTableEntry">20</td>
          <td class="headerCovTableEntry">14</td>
          <td class="headerCovTableEntryLo">70.0 %</td>
        </tr>
                <tr><td><img src="../../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<a name="1"><span class="lineNum">       1 </span>                : #ifndef COMBINATORY_POLICY_COMP_IMP_H</a>
<span class="lineNum">       2 </span>                : #define COMBINATORY_POLICY_COMP_IMP_H
<span class="lineNum">       3 </span>                : 
<span class="lineNum">       4 </span>                : #include &lt;mili/mili.h&gt;
<span class="lineNum">       5 </span>                : #include &quot;common_types.h&quot;
<span class="lineNum">       6 </span>                : #include &quot;combinatory_policy.h&quot;
<span class="lineNum">       7 </span>                : 
<span class="lineNum">       8 </span>                : /*! Primitivas Combinatorias Compuestas */
<span class="lineNum">       9 </span>                : 
<a name="10"><span class="lineNum">      10 </span>                : /*! Implementacion de politica de Secuencia de Combinatorias */</a>
<span class="lineNum">      11 </span>                : class SeqCombinatorialGroup: public CombinatoryPolicy
<span class="lineNum">      12 </span><span class="lineCov">              1 : {</span>
<span class="lineNum">      13 </span>                : private:
<span class="lineNum">      14 </span>                :     typedef std::list&lt;CombinatoryPolicy*&gt; CombinatorialGroup;
<span class="lineNum">      15 </span>                :     typedef CAutonomousIterator&lt;CombinatorialGroup&gt; CombGroupIterator;
<span class="lineNum">      16 </span>                :     typedef std::list&lt;Avs&gt; CombinatorialArguments;
<span class="lineNum">      17 </span>                :     typedef CAutonomousIterator&lt;CombinatorialArguments&gt; CombArgIterator;
<span class="lineNum">      18 </span>                : 
<span class="lineNum">      19 </span>                :     CombinatorialGroup combAlgs;     //! grupo de observadores de terapias
<span class="lineNum">      20 </span>                :     CombinatorialArguments combArgs;
<span class="lineNum">      21 </span>                : 
<a name="22"><span class="lineNum">      22 </span>                : public:</a>
<span class="lineNum">      23 </span>                :     //! Constructor
<span class="lineNum">      24 </span><span class="lineCov">              1 :     SeqCombinatorialGroup(const std::string&amp; name)</span>
<span class="lineNum">      25 </span><span class="lineCov">              1 :             : CombinatoryPolicy(name), combAlgs()</span>
<span class="lineNum">      26 </span><span class="lineCov">              1 :     {}</span>
<span class="lineNum">      27 </span>                : 
<span class="lineNum">      28 </span>                :     virtual bool combine(const Avs&amp; elements, CombinationObserver* observer, CombinationStatus&amp; status);
<span class="lineNum">      29 </span>                :     //! Metodos para interactuar con los algoritmos combinatorios
<span class="lineNum">      30 </span>                :     inline void add_policy(CombinatoryPolicy* comb, const Avs&amp; elements);
<a name="31"><span class="lineNum">      31 </span>                : };</a>
<span class="lineNum">      32 </span>                : 
<span class="lineNum">      33 </span><span class="lineCov">              2 : inline void SeqCombinatorialGroup::add_policy(CombinatoryPolicy* comb, const Avs&amp; elements)</span>
<span class="lineNum">      34 </span>                : {
<span class="lineNum">      35 </span><span class="lineCov">              2 :     insert_into(combAlgs, comb);</span>
<span class="lineNum">      36 </span><span class="lineCov">              2 :     insert_into(combArgs, elements);</span>
<span class="lineNum">      37 </span><span class="lineCov">              2 : }</span>
<span class="lineNum">      38 </span>                : 
<span class="lineNum">      39 </span>                : /*! Implementacion de politica Combinatorias Paralelas */
<span class="lineNum">      40 </span>                : 
<span class="lineNum">      41 </span>                : class ParallelCombinatory : public CombinatoryPolicy
<span class="lineNum">      42 </span>                : {
<span class="lineNum">      43 </span>                : private:
<a name="44"><span class="lineNum">      44 </span>                : </a>
<span class="lineNum">      45 </span>                :     struct AuxObserver
<a name="46"><span class="lineNum">      46 </span><span class="lineCov">              3 :     {</span></a>
<span class="lineNum">      47 </span>                :         virtual bool combine_obs(const Avs* combination, const Avs* itemsAvailable) = 0;
<span class="lineNum">      48 </span><span class="lineCov">              3 :         virtual ~AuxObserver() {};</span>
<span class="lineNum">      49 </span>                :     };
<a name="50"><span class="lineNum">      50 </span>                : </a>
<span class="lineNum">      51 </span>                :     struct InterObserver
<a name="52"><span class="lineNum">      52 </span><span class="lineCov">              2 :     {</span></a>
<span class="lineNum">      53 </span>                :         virtual void set_next_obs(AuxObserver* obs) = 0;
<span class="lineNum">      54 </span><span class="lineCov">              2 :         virtual ~InterObserver() {};</span>
<span class="lineNum">      55 </span>                :     };
<span class="lineNum">      56 </span>                : 
<span class="lineNum">      57 </span>                :     //! Observador intermedio
<span class="lineNum">      58 </span>                :     class AuxObserverImp: public AuxObserver, public InterObserver, private CombinationObserver
<span class="lineNum">      59 </span>                :     {
<span class="lineNum">      60 </span>                :         CombinatoryPolicy* const comb;            //! politica asociada
<span class="lineNum">      61 </span>                :         const Avs reference_elements;             //! argumento de la politica
<span class="lineNum">      62 </span>                :         Avs lastComb;                             //! ultima combinacion
<span class="lineNum">      63 </span>                :         AuxObserver* nextObs;                     //! siguiente observador auxiliar
<span class="lineNum">      64 </span>                :         const bool isMandatory;                   //! si la politica asociada es mandatoria
<span class="lineNum">      65 </span>                :         const Avs* itAvailable;                   //! elementos diponibles para la combinacion
<span class="lineNum">      66 </span>                :         CombinationStatus&amp; subCombStatus;
<span class="lineNum">      67 </span>                : 
<span class="lineNum">      68 </span>                :         virtual bool update(const Avs* t);
<span class="lineNum">      69 </span>                : 
<a name="70"><span class="lineNum">      70 </span>                :     public:</a>
<span class="lineNum">      71 </span>                :         //! Constructor
<span class="lineNum">      72 </span><span class="lineCov">              2 :         AuxObserverImp(CombinatoryPolicy* comb, const Avs&amp; reference_elements, bool isMandatory, CombinationStatus&amp; subCombStatus)</span>
<span class="lineNum">      73 </span><span class="lineCov">              2 :                 : comb(comb), reference_elements(reference_elements), lastComb(), nextObs(NULL), isMandatory(isMandatory), itAvailable(), subCombStatus(subCombStatus)</span>
<a name="74"><span class="lineNum">      74 </span><span class="lineCov">              2 :         {}</span></a>
<span class="lineNum">      75 </span>                :         //! Destructor
<span class="lineNum">      76 </span><span class="lineCov">              2 :         ~AuxObserverImp()</span>
<span class="lineNum">      77 </span><span class="lineCov">              2 :         {</span>
<span class="lineNum">      78 </span>                :             //delete comb;
<span class="lineNum">      79 </span><span class="lineCov">              2 :             delete nextObs;</span>
<span class="lineNum">      80 </span><span class="lineCov">              2 :         }</span>
<span class="lineNum">      81 </span>                : 
<span class="lineNum">      82 </span>                :         virtual void set_next_obs(AuxObserver* obs);
<span class="lineNum">      83 </span>                :         virtual bool combine_obs(const Avs* combination, const Avs* itemsAvailable);
<span class="lineNum">      84 </span>                :     };
<span class="lineNum">      85 </span>                : 
<span class="lineNum">      86 </span>                : 
<span class="lineNum">      87 </span>                :     //! Observador Final
<span class="lineNum">      88 </span>                :     class FinalObserver :  public AuxObserver
<span class="lineNum">      89 </span>                :     {
<span class="lineNum">      90 </span>                :         CombinationObserver* observed_by;
<a name="91"><span class="lineNum">      91 </span>                :     public:</a>
<span class="lineNum">      92 </span>                :         //! Constructor
<span class="lineNum">      93 </span><span class="lineCov">              1 :         FinalObserver()</span>
<span class="lineNum">      94 </span><span class="lineCov">              1 :                 : observed_by(NULL)</span>
<a name="95"><span class="lineNum">      95 </span><span class="lineCov">              1 :         {}</span></a>
<span class="lineNum">      96 </span>                :         //! Destructor
<span class="lineNum">      97 </span><span class="lineCov">              1 :         ~FinalObserver()</span>
<span class="lineNum">      98 </span><span class="lineCov">              1 :         {}</span>
<span class="lineNum">      99 </span>                :         virtual bool combine_obs(const Avs* combination, const Avs* itemsAvailable);
<span class="lineNum">     100 </span>                :         inline void set_final_obs(CombinationObserver* obs);
<span class="lineNum">     101 </span>                :     };
<span class="lineNum">     102 </span>                : 
<span class="lineNum">     103 </span>                :     AuxObserverImp* firstObs;
<span class="lineNum">     104 </span>                :     AuxObserverImp* lastObs;
<span class="lineNum">     105 </span>                :     FinalObserver* finalObs;
<span class="lineNum">     106 </span>                :     CombinationStatus subCombStatus;
<span class="lineNum">     107 </span>                :  
<a name="108"><span class="lineNum">     108 </span>                : public:</a>
<span class="lineNum">     109 </span>                :     //! Constructor
<span class="lineNum">     110 </span><span class="lineCov">              1 :     ParallelCombinatory(const std::string&amp; name)</span>
<span class="lineNum">     111 </span><span class="lineCov">              1 :             : CombinatoryPolicy(name), firstObs(NULL), lastObs(NULL), finalObs(new FinalObserver()),subCombStatus()</span>
<a name="112"><span class="lineNum">     112 </span><span class="lineCov">              1 :     {}</span></a>
<span class="lineNum">     113 </span>                :     //! Destructor
<span class="lineNum">     114 </span><span class="lineCov">              1 :     ~ParallelCombinatory()</span>
<span class="lineNum">     115 </span><span class="lineCov">              1 :     {</span>
<span class="lineNum">     116 </span><span class="lineCov">              1 :         delete firstObs;</span>
<span class="lineNum">     117 </span><span class="lineCov">              1 :     }</span>
<span class="lineNum">     118 </span>                :     void add_policy(CombinatoryPolicy* policy, const Avs&amp; reference_elements, bool isMandatory);
<span class="lineNum">     119 </span>                :     virtual bool combine(const Avs&amp; elements, CombinationObserver* observer, CombinationStatus&amp; status);
<span class="lineNum">     120 </span>                : };
<a name="121"><span class="lineNum">     121 </span>                : </a>
<span class="lineNum">     122 </span>                : //! set / reset del observador final
<span class="lineNum">     123 </span><span class="lineCov">              1 : inline void ParallelCombinatory::FinalObserver::set_final_obs(CombinationObserver* obs)</span>
<span class="lineNum">     124 </span>                : {
<span class="lineNum">     125 </span><span class="lineCov">              1 :     observed_by = obs;</span>
<span class="lineNum">     126 </span><span class="lineCov">              1 : }</span>
<span class="lineNum">     127 </span>                : 
<span class="lineNum">     128 </span>                : #endif
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.7</a></td></tr>
  </table>
  <br>

</body>
</html>
